package com.xuzimian.globaldemo.spring.springrpc.webservice;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import javax.xml.ws.Endpoint;
import java.io.IOException;

/**
 * @program: global-demo
 * @description:
 * @author: xzm
 * @create: 2019-01-16 16:56
 **/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes ={WebServiceConfig.class,SpringWebServiceImpl.class} )
public class WebServiceDemo {

    @Autowired
    private SpringWebService clientSpringWebService;

    @Test
    public void clientCallWebService() throws IOException {
        System.out.println(clientSpringWebService.doSomething("WebServiceDemo"));
        System.in.read();
    }

    public static void main(String[] args) {
        Endpoint.publish("http://127.0.0.1:8080/", new SpringWebServiceImpl());

    }
}
